package com.example.wheresdu_test;

import android.app.Activity;
import android.graphics.PixelFormat;
import android.os.Bundle;
import android.view.Window;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.content.Intent;
import android.os.Handler;

public class MainActivity extends Activity {
	 public void onAttachedToWindow() {
         super.onAttachedToWindow();
         Window window = getWindow();
         window.setFormat(PixelFormat.RGBA_8888);
     }
	 private static int SPLASH_TIME_OUT=3000;
 /** Called when the activity is first created. */
 @Override

 
 public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.activity_main);
     StartAnimations();
     new Handler().postDelayed(new Runnable(){
    	 
    	 public void run(){
    		 Intent i=new Intent(MainActivity.this,MainActivity1.class);
    		 
    		 MainActivity.this.startActivity(i);
    		 finish();
    	 }
     
 }, SPLASH_TIME_OUT);

 }
 private void StartAnimations() {
     Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);
     anim.reset();
     RelativeLayout l=(RelativeLayout) findViewById(R.id.lin_lay);
     l.clearAnimation();
     l.startAnimation(anim);

     anim = AnimationUtils.loadAnimation(this, R.anim.translate);
     anim.reset();
     ImageView iv = (ImageView) findViewById(R.id.logo);
     iv.clearAnimation();
     iv.startAnimation(anim);
 }

}
